import React from 'react';
import {Provider, observer, inject} from 'mobx-react';
import {withRouter} from 'react-router-dom';
import {Tools, Button} from 'weaver-mobile';
import {toJS} from "mobx";

import SignGroupPage from './SignGroupPage';
// import {getQueryString} from '../../util/getUrlParams';

import {RouteLayout} from 'weaver-mobile-page';

const getLocaleLabel = Tools.getLocaleLabel;
const ButtonGroup = RouteLayout.ButtonGroup;
@inject("odocComsStore")
@observer
export default class OdocCusTab extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            loadLang: false
        };
    }

    componentDidMount() {

    }

    componentWillMount() {
    }

    componentWillUnMount() {

    }


    render() {
        const {odocComsStore,cusTabStore} = this.props;
        let store = cusTabStore || odocComsStore;
        let {requestParam = {}, urlParams = {}, workflowStores} = store;
        let {id, tabType, url} = toJS(urlParams);
        const buttonGroupData = [
            {
                key: 'back',
                text: '返回',
                onClick: () => window.history.go(-1),
                type: "primary"
            }
        ];
        return (
            <div style={{height: "100%"}}>
                <div style={{height: "100%"}}>
                    {
                        tabType == 1 && <div style={{height:"100%"}}><iframe style={{height:"100%",width:"100%"}} src={url} frameBorder="0" id={"odoc_workflow_cus_iframe"}></iframe></div>
                    }
                    {
                        tabType == 2 && <SignGroupPage cusTabStore={store}/>
                    }
                </div>
                {/*<ButtonGroup data={buttonGroupData} isButton={true} />*/}
            </div>
        );
    }
}